<html><head><title></title>
<script type="text/javascript">
function get_grids() {
	var ret = [];
	for (var i = 0; i<localStorage.length; i++) {
		var key = localStorage.key(i);
		if ("options."==key.substr(0, 8)) {
			continue;
		}
		try {
			var data = JSON.parse(localStorage.getItem(key));
			ret.push([key, data[1]]);
		} catch(e) {
		}
	}
	return ret;
}

function init() {
	var ret = get_grids();
	console.log("grids:" + ret.length);
	if (ret.length) {
		var dt = new Date();
		var s = "";
		for (var i = 0;i<ret.length;i++) {
			dt.setTime(ret[i][1]);
			s+= '<a href="grid.html?p=' + ret[i][0] + '">'+dt+'</a><br>'; 
		}
		document.getElementById("grids").innerHTML = s;
	}
}

</script>
</head><body onload="init()">
<h1>Your SUDOKUs</h1>
<div id="grids">
...none...
</div>
<a href="grid.html">Start a new one</a>
</body></html>

